package com.mujin.keji.collectionsystem.module.outboundtask.viewmodel;

import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.ViewModel;

import com.mujin.keji.collectionsystem.base.BaseDto;
import com.mujin.keji.collectionsystem.module.outboundtask.dto.CallDto;
import com.mujin.keji.collectionsystem.module.outboundtask.repository.CallRepository;
import com.mujin.keji.collectionsystem.module.outboundtask.repository.ICallRepository;
import com.mujin.keji.collectionsystem.module.outboundtask.vo.CallVo;

/**
 * 一键报警viewmodel
 *
 * @author weishixiong
 * @Time 2018-05-3
 */

public class OneCallViewModel extends ViewModel {
    private LiveData<BaseDto<CallDto>> liveData;
    private ICallRepository callRepository;

    /**
     * @param calleeNumber 被叫
     * @param imei         imei
     * @return
     */
    public LiveData<BaseDto<CallDto>> getLiveData(String calleeNumber, String imei, String answering, String caseId, String relation) {
        callRepository = new CallRepository();
        CallVo vo = new CallVo();
        vo.setCalleeNumber(calleeNumber);
        vo.setImei(imei);
        vo.setAnswering(answering);
        vo.setCaseId(caseId);
        vo.setRelation(relation);
        this.liveData = callRepository.call(vo);
        return liveData;
    }
}
